package com.chinaums.fsp.sdk.request;

import com.chinaums.fsp.base.pgt.TransType;
import com.chinaums.fsp.sdk.base.RequestData;
import com.chinaums.fsp.sdk.base.ResponseDataWrapper;
import com.chinaums.fsp.sdk.pgt.params.DraftDealRequest;
import com.chinaums.fsp.sdk.pgt.params.DraftDealResponse; 
/**
 * 汇票交易验证机构，生成记录
 * @author hhh
 */
public class DraftDealCreateOrderTest extends BaseRequest{

	public void testDraftDealRequest() throws Exception {
		
		PgtRequestFactory rf = FACTORY.factory();
		RequestData.Builder builder = this.createRequestDataBuilder();
		builder.setTransType(TransType.TRANSACTION_CREATE_ORDER.getTransCode());
		
		DraftDealRequest data = DraftDealRequest.newBuilder()
//															.setBuyerWalletNo("801000000001399")
//															.setSellerWalletNo("801000000001479")
															.setBuyerWalletNo("801000000000106")
															.setSellerWalletNo("801000000000078")
															.setTransAmount(9000L)
															.setTransFee(100L)
															.setBuyerFeePercent(0.6)
															// 票据信息：选填
															.setDrawerName("宁波云曌投资管理有限公司")
															.setDrawerAccountNo("77010122000866693")
															.setDrawerBank("宁波银行股份有限公司北京分行营业部")
															.setAcceptanceBankNo("307581009013")
															.setAcceptanceBankAccountNo("77010122000866693")
															.setAcceptanceBankSimpleName("宁波银行股份有限公司北京分行营业部")
															.setTakerName("天津云金投资管理有限公司")
															.setTakerAccountNo("8110701012900865071")
															.setTakerBank("中信银行股份有限公司北京太阳宫支行")
															// 票据信息：五要素
															.setInvoiceNo("231310002005220190429386613331")
															.setInvoiceAmount(10000L)
															.setIssueDate("")
															.setExpireDate("20190701")
															.setAcceptanceBankNo("313100020052")//承兑银行联行号，313100020052  
															.setAcceptanceBank("宁波银行股份有限公司北京分行营业部")//承兑银行名称，宁波银行股份有限公司北京分行营业部
															.setRedirectPlatformUrl("http://www.baidu.com")
//															.setWithdrawType(1)
															.setSellerSign("1")//1:已签约
															.setReceivableAccountNo("80341100690011319")
															//被背书人银行账号，不填默认为用户选择的默认核验卡
															.setBuyerEndorseBankCard("125985263258")
															//背书人银行账号
															.setSellerEndorseBankNo("77011262000811369")
															//背书人银行联行号
															.setSellerEndroseSettleNo("302110023147")
															//PAB（平安） 或 CCB（中信）
															.setVerificationType(0)
															.build()
															;
		rf.transType(TransType.TRANSACTION_CREATE_ORDER.getTransCode())
//		rf.transTypeAndClientId(TransType.TRANSACTION_CREATE_ORDER.getTransCode(), "00001235648796521365")
		.responseClass(DraftDealResponse.class)
		.data(data)
		;
		ResponseDataWrapper rdw = rf.post();
	
		this.print(rdw);
	}
	
}